package com.qianli.cashmama.trade.integration.user;

import com.fqgj.xjd.user.client.enums.FrozenCodeEnum;
import com.fqgj.xjd.user.client.enums.UserEventTrackEnum;
import com.fqgj.xjd.user.client.response.User;
import com.fqgj.xjd.user.client.response.UserAccessInfo;
import com.fqgj.xjd.user.client.response.UserContactSms;
import com.qianli.cashmama.trade.common.dto.UserTradeSnapshotDto;
import com.qianli.cashmama.trade.integration.user.dto.UserBankDto;
import com.qianli.cashmama.trade.integration.user.dto.UserBaseInfoDto;
import com.qianli.cashmama.trade.integration.user.dto.UserContactAddressBookDto;
import com.qianli.cashmama.trade.integration.user.dto.UserLoginInfoDto;
import com.qianli.user.enums.UserAuthEnum;
import com.qianli.user.enums.UserAuthStatusEnum;

import java.util.List;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/20
 * Time: 下午5:40
 */
public interface UserIntegrationService {

    /**
     * @param userCode
     * @return
     */
    User getUserByUserCode(String userCode);

    UserAccessInfo getUserAccessInfoByUserCode(String userCode);

    UserAccessInfo getUserAccessInfoByMobile(String mobile, String appCode);

    /**
     * @param userCode
     * @return
     */
    UserBaseInfoDto getUserBaseInfoByUserCode(String userCode, String productCategory);

    /**
     * @param userCode
     * @return
     */
    UserContactAddressBookDto getUserDeviceContactByUserCode(String userCode);

    /**
     * @param userCode
     * @return
     */
    UserTradeSnapshotDto getUserTradeSnapshotInfoByUserCode(String userCode, String productCategory);

    /**
     * @param userCode
     * @param productCategory
     * @param noNeed
     * @return
     */
    UserTradeSnapshotDto getUserTradeSnapshotInfoByUserCode(String userCode, String productCategory, Set<String> noNeed);

    /**
     * @param userCode
     * @return
     */
    UserBankDto getUserBankSnapshotByUserCode(String userCode);

    /**
     * @param userCode
     * @return
     */
    Boolean changeUserBankStatus(String userCode);


    /**
     * 冻结用户
     *
     * @param userCode
     * @return
     */
    boolean frozenUser(String userCode, String productCategory, FrozenCodeEnum frozenCodeEnum);

    /**
     * @param userCode
     * @return
     */
    String getUserWifiNameByUserCode(String userCode);

    /**
     * 获取渠道表最近几小时内的用户注册渠道
     *
     * @param hour
     * @return
     */
    List<String> getLatestChannelFromRegister(Integer hour);

    /**
     * 获取用户登录基本信息
     */
    UserLoginInfoDto getUserLoginInfo(String userCode);

    /**
     * 重绑卡
     *
     * @param userCode
     * @param ifscCode
     * @param cardNumber
     * @param bankName
     * @return
     */
    boolean reBindCard(String userCode, String ifscCode, String cardNumber, String bankName);

    /**
     * 更新状态信息
     *
     * @param userCode
     * @param userAuthEnum
     * @param userAuthStatusEnum
     * @return
     */
    boolean updateUserAuthStatus(String userCode, UserAuthEnum userAuthEnum, UserAuthStatusEnum userAuthStatusEnum);

    /**
     * 用户复制
     *
     * @param userCode
     * @param targetAppCode
     * @param originCategoryCode
     * @param targetCategoryCode
     * @return
     */
    String copyUser(String userCode, String targetAppCode, String originCategoryCode, String targetCategoryCode);

    /**
     * 查询短信
     *
     * @param userCode
     * @return
     */
    UserContactSms getUserDeviceSmsByUserCode(String userCode);

    /**
     * 添加用户埋点
     *
     * @param userCode
     * @param userEventTrackEnum
     */
    void addUserEventTrack(String userCode, UserEventTrackEnum userEventTrackEnum);
}
